using GameStore.Api.Data;
using GameStore.Api.Endpoints;
using GameStore.Api.Repositoriesa;
using Microsoft.EntityFrameworkCore;

var builder = WebApplication.CreateBuilder(args);
// builder.Services.AddScoped<IGamesRepository, InMemGamesRepository>();
// builder.Services.AddSingleton<IGamesRepository, InMemGamesRepository>();
builder.Services.AddScoped<IGamesRepository, EntityFrameworkGamesRepository>();

builder.Services.AddRepositories(builder.Configuration);

var app = builder.Build();

app.Services.InitalizeDb();

app.MapGet("/", () => "Hello World!");
// 
app.MapGamesEndpoints();

app.Run();


















